[!outputon]
[!if=(EndUser, "True")]
<%%%% if (EndUser.Logout != null) { %%%%>
<%%%%   if (EndUser.DisplayName != '') { %%%%>
  <h1>Welcome <%%%%=EndUser.DisplayName %%%%></h1>
<%%%%   } %%%%>
<%%%%   if (EndUser.Logout.Enabled) { %%%%>
  <a href="<%%%%=EndUser.Logout.AsHREF%%%%>">Logout</a>
<%%%%   } %%%%>
<%%%%   if (EndUser.LoginForm.Enabled) { %%%%>
  <a href=<%%%%=EndUser.LoginForm.AsHREF%%%%>>Login</a>
<%%%%   } %%%%>
<%%%% } %%%%>
[!endif]
[!if=(PageLinks, "True")]
<table cellspacing="0" cellpadding="0">
<td>
<%%%%  e = new Enumerator(Pages)
     s = ''
     c = 0
     for (; !e.atEnd(); e.moveNext())
     {
       if (e.item().Published)
       {
         if (c>0) s += '&nbsp;%0:s&nbsp;'
         if (Page.Name != e.item().Name)
           s += '<a href="' + e.item().HREF + '">' + e.item().Title + '</a>'
         else
           s += e.item().Title
         c++
       }
     }
     if (c>1) Response.Write(s)
%%%%>
</td>
</table>

[!endif]
[!if=(HTMLStandard, "True")]
<html>
<head>
<title>
<%%%%= Page.Title %%%%>
</title>
</head>
<body>
<h1><%%%%= Application.Title %%%%></h1>
%2:s
<h2><%%%%= Page.Title %%%%></h2>
%1:s
%%0:s
</body>
</html>
[!endif]
[!if=(XSLStandard, "True")]
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
</xsl:stylesheet>
[!endif]
[!if=(XSLDataPacket, "True")]
[!outputoff]
* datapacket xsl template
* 0 - separator character
* note that xml must start on first line
[!outputon]
<?xml version="1.0"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="DATAPACKET">
    <table border="1">
      <xsl:apply-templates select="METADATA/FIELDS"/>
      <xsl:apply-templates select="ROWDATA/ROW"/>
    </table>
  </xsl:template>

  <xsl:template match="FIELDS">
    <tr>
      <xsl:apply-templates/>
    </tr>
  </xsl:template>

  <xsl:template match="FIELD">
    <th>
      <xsl:value-of select="@attrname"/>
    </th>
  </xsl:template>

  <xsl:template match="ROWDATA/ROW">
  <xsl:variable name="fieldDefs" select="//METADATA/FIELDS"/>
  <xsl:variable name="currentRow" select="current()"/>
  <tr>
    <xsl:for-each select="$fieldDefs/FIELD">
      <td>
         <xsl:value-of select="$currentRow/@*[name()=current()/@attrname]"/><br/>
      </td>
    </xsl:for-each>
  </tr>
  </xsl:template>

</xsl:stylesheet>
[!endif]
